#pragma once
#include <Windows.h>
#include <d3d9.h>
#include <d3dx9.h>

class CDxDevice
{
private:
	// private variables
	LPDIRECT3D9 m_d3d;
	LPDIRECT3DDEVICE9 m_d3ddev;
	LPDIRECT3DSURFACE9 m_surface;
	LPDIRECT3DSURFACE9 m_backbuffer;
	D3DPRESENT_PARAMETERS m_d3dpp;
public:
	// constructors & destructor
	CDxDevice(void);
	~CDxDevice(void);
	CDxDevice(HWND hWnd);
	// Methods
	bool Create_Direct9();
	bool Create_D3DPP(HWND hWnd);
	bool CreateDXDevice(HWND hWnd);
	void LoadImageFromFile(char* filePath,D3DCOLOR transColor);
	LPDIRECT3DDEVICE9 GetDevice();
	LPDIRECT3D9 GetD3D();
	D3DPRESENT_PARAMETERS GetD3DPP();
	LPDIRECT3DSURFACE9 GetSurface();
	LPDIRECT3DSURFACE9 GetBackbuffer();
};

